package com.own.business.wallet.business.service;

import com.own.business.wallet.entity.bo.WalletBo;
import com.own.business.wallet.entity.map.WalletMapVo;
import com.own.business.wallet.entity.po.Wallet;
import com.own.business.wallet.entity.query.WalletQuery;
import com.own.business.wallet.entity.vo.WalletVo;
import com.own.component.common.base.service.BaseService;

/**
 * WalletService
 *
 * @author chenxueli
 * @date 2023-07-13 16:07:39
 */
public interface WalletService extends BaseService<
        Wallet,
        WalletBo,
        WalletVo,
        WalletMapVo,
        WalletQuery
        > {

    /**
     * 根据用户id获取钱包数据
     *
     * @param userId 用户id
     * @return 钱包数据
     */
    Wallet getByUserId(Long userId);

    /**
     * 验证支付密码是否正确
     *
     * @param userId   用户id
     * @param password 支付密码
     * @return 是否正确
     */
    boolean checkPassword(Long userId, String password);

    /**
     * 修改密码
     *
     * @param userId   用户id
     * @param password 密码
     */
    void updatePassword(Long userId, String password);

    /**
     * 增加余额
     *
     * @param walletId 钱包id
     * @param balance  余额
     */
    void increase(Long walletId, Integer balance);

    /**
     * 减少余额
     *
     * @param walletId 钱包id
     * @param balance  余额
     */
    void decrease(Long walletId, Integer balance);

}

